'use strict';
const Controller = require('egg').Controller;
class HomeController extends Controller {
  async index() {
    const { ctx } = this;
    ctx.body = 'hi, egg';
  }
  async getuser() {
    const { ctx } = this;
    let { uid } = ctx.query;
    ctx.body = {
      code: 1,
      uid,
      mes: '获取用户'
    }
  }
  async add() {
    const { ctx } = this;
    let { name, num, word } = ctx.request.body;
    ctx.body = {
      code: 0,
      name,
      num,
      word,
      mes: '添加成功'
    }
  }
  async getlist(){
    const {ctx} = this;
    let res = await ctx.service.home.getlist();
    ctx.body = {
      code:0,
      res,
      mes:'list'
    }

  }
}
module.exports = HomeController;
